package com.bgs.engineering.api.sysUser.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bgs.engineering.util.pageUtil.PageRequest;
import com.bgs.engineering.api.sysUser.entiy.SysUser;
import com.bgs.engineering.api.sysUser.model.SysUserModel;
import com.bgs.engineering.common.errorCode.CommonException;
import com.bgs.engineering.common.response.CommonResult;

/**
 * @ClassName UserService
 * @Description 系统用户服务类
 * @Author zcy
 * @Date 2023/3/24 15:43
 **/
public interface SysUserService extends IService<SysUser> {
  /**
   * 通过登录名登录
   *
   * @param loginName
   * @return
   */
  SysUser getUserByLoginName(String loginName);

  /**
   * <<<<<<< HEAD
   * =======
   * 通过邮箱查询用户
   *
   * @param emailAccount
   * @return
   */
  SysUser getUserByEmailAccount(String emailAccount);

  /**
   * >>>>>>> e0aefc56a8feec46acb2f855ecee57ade0a02be2
   * 修改用户状态
   *
   * @param sysUser
   */
  void updateUserByLogin(SysUser sysUser);

  /**
   * 新增用户
   *
   * @param sysUserModel
   * @return
   */
  CommonResult saveUser(SysUserModel sysUserModel) throws CommonException;

  /**
   * 修改用户信息
   *
   * @param sysUserModel
   * @return
   */
  CommonResult updateUser(SysUserModel sysUserModel) throws CommonException;

  /**
   * 删除用户
   *
   * @param id
   * @return
   */
  CommonResult delUserById(Integer id) throws CommonException;

  /**
   * 分页查询
   *
   * @param sysUserModel
   * @param pageRequest
   * @return
   */
  CommonResult getUserByPage(SysUserModel sysUserModel, PageRequest pageRequest);

  /**
   * 根据手机号查询用户信息
   *
   * @param phoneAccount
   * @return
   */
  SysUser getUserByPhoneAccount(String phoneAccount);
}
